<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>判断鼠标左右键mouse-L-mouse&R-mouse</title>
</head>
<body>
<script>
    document.onmousedown = function (e) {
        if(e.button == 2){
            console.log("right");
        }else if(e.button == 0){
            console.log("left")
        }
    }
</script>
</body>
</html>
